Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tests #620

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

add tests #620

wants to merge 1 commit into from

Conversation

KatOlista
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the getHumanAge function! 🎉 The code meets the task requirements and constraints, and the test cases are well-structured to cover various scenarios. While there are some minor issues with the test descriptions, they don't impact the functionality of your solution. Keep up the good work, and consider refining the test descriptions for clarity in future projects. 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

@@ -7,4 +7,37 @@ describe('getHumanAge', () => {
expect(getHumanAge)
.toBeInstanceOf(Function);
});

test('should return 0, if animalAge less than first', () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description mentions 'animalAge less than first', but it should specify that both catAge and dogAge are less than 15, which is the threshold for the first human year according to the task description.

expect(result).toEqual([0, 0]);
});

test(`should return 1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description is unclear. It should specify that catAge and dogAge are between 15 and 24, which corresponds to 1 human year according to the task description.

expect(result).toEqual([1, 1]);
});

test(`should return 2, if animalAge equal (first + second)`, () => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description should specify that catAge and dogAge are exactly 24, which corresponds to 2 human years according to the task description.

expect(result).toEqual([2, 2]);
});

test(`should return correct value,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description should specify that catAge and dogAge are more than 24, which corresponds to more than 2 human years according to the task description.

expect(result).toEqual([3, 2]);
});

test(`should return correct value, if one animalAge equal (first + second)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the test description: 'animalAgemore' should be 'animalAge more'. Additionally, the description should clarify that one of the ages is exactly 24 and the other is more than 24.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants